package com.swagger.controller;

import com.swagger.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @GetMapping("/hello")
 public String hello(){
     return "hello";
 }
    @ApiOperation("User的控制")
   //  返回值存在实体类  ta就会 扫描到swagger中去
    @PostMapping("/user")
    public String user(@ApiParam("用户名") String username){
        return username;
    }
}
